package guess;

import java.util.Random;
import java.util.Scanner;

public class game {
    public void menu(){
        System.out.println("*****************************");
        System.out.println("**  1.play         2.exit  **");
        System.out.println("*****************************");
    }
    public void guessgame(){
        Random r = new Random();
        Scanner scanner = new Scanner(System.in);
        int num = r.nextInt(101);
        int guess = 0;
        while(guess!=num){
            System.out.println("请输入1-100的数字");
            guess = scanner.nextInt();
            if(guess>num)
            {
                System.out.println("太大啦！！");
            }
            else if(guess<num)
            {
                System.out.println("太小啦！！");
            }
            else
            {
                System.out.println("哎呦不错哦！");
                break;
            }
        }

    }
}
